package blog.spring.db.entity;

// Generated 2015-1-30 0:04:13 by Hibernate Tools 4.0.0

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.OneToOne;
import javax.persistence.PrimaryKeyJoinColumn;
import javax.persistence.Table;
import org.hibernate.annotations.GenericGenerator;
import org.hibernate.annotations.Parameter;

/**
 * ArticleContent generated by hbm2java
 */
@Entity
@Table(name = "article_content", catalog = "blog")
public class ArticleContent implements java.io.Serializable {

	private int articleId;
	private ArticleInfo articleInfo;
	private String content;
	private int hits;

	public ArticleContent() {
	}

	@GenericGenerator(name = "generator", strategy = "foreign", parameters = @Parameter(name = "property", value = "articleInfo"))
	@Id
	@GeneratedValue(generator = "generator")
	@Column(name = "article_id", unique = true, nullable = false)
	public int getArticleId() {
		return this.articleId;
	}

	public void setArticleId(int articleId) {
		this.articleId = articleId;
	}

	@OneToOne(fetch = FetchType.LAZY)
	@PrimaryKeyJoinColumn
	public ArticleInfo getArticleInfo() {
		return this.articleInfo;
	}

	public void setArticleInfo(ArticleInfo articleInfo) {
		this.articleInfo = articleInfo;
	}

	@Column(name = "content", length = 65535)
	public String getContent() {
		return this.content;
	}

	public void setContent(String content) {
		this.content = content;
	}

	@Column(name = "hits", nullable = false)
	public int getHits() {
		return this.hits;
	}

	public void setHits(int hits) {
		this.hits = hits;
	}

}
